//
//  HTCityDetailTableViewCell.m
//  HeartTravel
//
//  Created by lanou on 15/11/2.
//  Copyright © 2015年 陈文杰. All rights reserved.
//

#import "HTCityDetailTableViewCell.h"
#import "UIImageView+WebCache.h"
@implementation HTCityDetailTableViewCell
- (void)setConfigureModel:(HTCityDetailModel *)configureModel{
    _configureModel = configureModel;
    [_posterImageView sd_setImageWithURL:[NSURL URLWithString:configureModel.cover_s]];
    _titleLabel.text = configureModel.name;
    _desLabel.text = configureModel.recommended_reason;
    NSString *str = [NSString stringWithFormat:@"%@", configureModel.visited_count];
    _visitLabel.text = [str stringByAppendingFormat:@" 人去过"];
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        CGFloat width = SCREEN_WIDTH/3 - 20;
        _tagsImageView = [[UIImageView alloc]initWithFrame:CGRectMake(SCREEN_WIDTH - 35, 0, 18, 22)];
        _tagsImageView.image = [UIImage imageNamed:@"标签"];
        
        _posterImageView = [[UIImageView alloc]initWithFrame:CGRectMake(20, 25, width, width)];
        _posterImageView.image = [UIImage imageNamed:@"海"];
        _posterImageView.layer.cornerRadius = 5;
        _posterImageView.layer.masksToBounds = YES;
        
        _titleLabel = [[UILabel alloc]initWithFrame:CGRectMake(20 + width + 8, 25, 180, 30)];
        _titleLabel.font = [UIFont systemFontOfSize:18];
        
        _desLabel = [[UILabel alloc]initWithFrame:CGRectMake(28 + width, 50, SCREEN_WIDTH - 43 - width, 60)];
        _desLabel.numberOfLines = 0;
        _desLabel.font = [UIFont systemFontOfSize:15];
        
        _visitLabel = [[UILabel alloc]initWithFrame:CGRectMake(28 + width, 100, width, 30)];
        _visitLabel.font = [UIFont systemFontOfSize:15];
        
        [self.contentView addSubview:_tagsImageView];
        [self.contentView addSubview:_posterImageView];
        [self.contentView addSubview:_titleLabel];
        [self.contentView addSubview:_desLabel];
        [self.contentView addSubview:_visitLabel];
    }
    return self;
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
